package com.hq.ims.data.vo;

import com.hq.ims.data.entity.LogSysException;
import com.hq.utils.util.ListUtils;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;


/**
 * @author 蒋柏平
 * @since 20241108
 */
@Mapper
public interface LogSysExceptionMapstruct {

    LogSysExceptionMapstruct INSTANCE = Mappers.getMapper(LogSysExceptionMapstruct.class);

    //-------------------------------- 转换VO类 --------------------------------

    @Mappings({
    })
    LogSysExceptionVo toLogSysExceptionVo(LogSysException source);

    default List<LogSysExceptionVo> toLogSysExceptionVoList(List<LogSysException> source) {
        if (source == null) {
            return ListUtils.newEmptyList();
        }
        return source.stream().map(this::toLogSysExceptionVo).collect(Collectors.toList());
    }

    //-------------------------------- 以下为自定义类[输出对象] --------------------------------

    @ApiModel(value = "原始对象的扩展类")
    @Data
    class LogSysExceptionVo extends LogSysException {

    }

    //-------------------------------- 以下为自定义类[输入对象] --------------------------------

    @ApiModel(value = "搜索VO")
    @Data
    class PageSearchVo {

        private LocalDateTime beginTime;

        private LocalDateTime endTime;

    }

    @ApiModel(value = "添加和修改对象")
    @Data
    class SaveVo {

    }

    @Data
    class ClearLogVo {

        private LocalDateTime beginTime;

        private LocalDateTime endTime;

    }

    //-------------------------------- springboot验证标识 --------------------------------

}
